﻿#ifndef GTK_UI_PUBLIC_H
#define GTK_UI_PUBLIC_H

#if (defined _WIN64 || defined WIN64 || defined _WIN32 || defined WIN32 || defined WINCE)
	#if (defined _MSC_VER)
		#ifdef GTK_UI_DLL_EXPORTS
			#define GTKUI_DLL_API __declspec(dllexport)
		#else
			#define GTKUI_DLL_API 
		#endif
	#else
		#ifdef __GNUC__
			#ifdef GTK_UI_DLL_EXPORTS
				#define GTKUI_DLL_API __attribute__ ((dllexport))
			#else
				#define GTKUI_DLL_API __declspec(dllexport)
			#endif
		#else
			#define GTKUI_DLL_API
		#endif
	#endif
#elif defined ANDROID
    // ANDROID
	#ifdef __GNUC__
		#if __GNUC__ >= 4
			#define GTKUI_DLL_API __attribute__ ((visibility ("default")))
		#else
			#define GTKUI_DLL_API __attribute__ ((dllexport))
		#endif
	#else // CLang or other
		#define GTKUI_DLL_API
	#endif
#else
	// LINUX
	#ifdef __GNUC__
		#if __GNUC__ >= 4
			#define GTKUI_DLL_API __attribute__ ((visibility ("default")))
		#else
			#define GTKUI_DLL_API __attribute__ ((dllexport))
		#endif
	#else
		#define GTKUI_DLL_API
	#endif
#endif // _WIN64 || WIN64 || _WIN32 || WIN32 || WINCE

#ifdef __cplusplus
extern "C" {
#endif

GTKUI_DLL_API void *load_gtk_ui(const char* file_name);
GTKUI_DLL_API void  release_gtk_ui(void* gtk_ui_doc);

GTKUI_DLL_API void* get_gtk_ui_root(void* gtk_ui_doc);

GTKUI_DLL_API void* get_gtk_ui_first_child(void* gtk_ui_doc, void* node);
GTKUI_DLL_API void* get_gtk_ui_next_child(void* gtk_ui_doc, void* node, void* child);

GTKUI_DLL_API void* get_gtk_ui_parent(void* gtk_ui_doc, void* node);

GTKUI_DLL_API bool  get_gtk_ui_has_child_node(void* gtk_ui_doc, void* node, const char* name);
GTKUI_DLL_API void* get_gtk_ui_get_child_node(void* gtk_ui_doc, void* node, const char* name);

GTKUI_DLL_API const char* get_gtk_ui_node_name(void* gtk_ui_doc, void* node);
GTKUI_DLL_API const char* get_gtk_ui_node_value(void* gtk_ui_doc, void* node);

GTKUI_DLL_API void* get_gtk_ui_first_property(void* gtk_ui_doc, void* node);
GTKUI_DLL_API void* get_gtk_ui_next_property(void* gtk_ui_doc, void* node, void* attr);

GTKUI_DLL_API bool  get_gtk_ui_has_property(void* gtk_ui_doc, void* node, const char* name);
GTKUI_DLL_API void* get_gtk_ui_get_property(void* gtk_ui_doc, void* node, const char* name);

GTKUI_DLL_API const char* get_gtk_ui_property_name(void* gtk_ui_doc, void* node, void* attr);
GTKUI_DLL_API const char* get_gtk_ui_property_value(void* gtk_ui_doc, void* node, void* attr);


#ifdef __cplusplus
};
#endif

#endif // !GTK_UI_PUBLIC_H
